package com.my.study.util;

import org.springframework.core.ResolvableType;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: yidujun
 * @create: 2021/07/13 09:46
 */
public class ResolvableTypeTest {
    static Map<String, List<String>> map = new HashMap<>();
    public static void main(String[] args) throws NoSuchFieldException {
        ResolvableTypeTest test = new ResolvableTypeTest();

        ResolvableType resolvableType = ResolvableType.forField(test.getClass().getDeclaredField("map"));

        ResolvableType[] generics = resolvableType.getGenerics();

        ResolvableType[] interfaces = resolvableType.getInterfaces();

        Class<?> aClass = resolvableType.resolveGeneric(1, 0);
        String name = aClass.getName();
        System.out.println(name);

    }

}
